[#ftl]
[#--include "../../util.ftl"/--]

[@define "agile.form.CurrencyTextBox" "agile.form.NumberTextBox"]		
	category:"CurrencyTextBox Component"
	,widgetName:"CurrencyTextBox"
	,attributes:agile.delegate(agile.form.NumberTextBox.prototype.attributes,{
		"constraints.currency":lang.mixin({},agile.ComboMetadata,{
			label:"i18n_currency"
			,options:[{"value":""},{"value":"USD"},{"value":"HKD"},{"value":"CNY"}]	
			,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){
				if(!isNaN(value)){
					value = null;
				}
				widget.delegate.constraints.currency = value;
//				widget.metadata(name,value);
				widget.metadata(this.metadataCategory+"."+name,value);
				widget.delegate.reset1("value",widget.metadata("parameters.value"));
			}
		})
	})
	,_getDelegatePrototype:function(){
 		agile.requireX("dijit/form/CurrencyTextBox");
		return dijit.form.CurrencyTextBox.prototype;
	}
[/@]
